#define _CRT_SECURE_NO_WARNINGS 1


#include<stdio.h>
#include<assert.h>

//size_t my_strlen(char* str)
//{
//	assert(str);
//	char* p = str;
//	while (*p != '\0')
//	{
//		p++;
//	}
//	return p - str;
//}

size_t my_strlen(char* str)
{
	assert(str);
	if (*str != '\0')
		return 1 + my_strlen(str + 1);
	else
		return 0;
}

char* my_strcyp(char* dest, const char* src)
{
	assert(dest && src);
	char* ret = dest;
	while (*dest++ = *src++)
	{
		;
	}
	return ret;
}


char* my_strcat(char* dest, const char* src)
{
	assert(dest && src);
	char* ret = dest;
	while (*dest != '\0')
	{
		dest++;
	}
	while (*dest++ = *src++)
	{
		;
	}
	return ret;
}


int main()
{
	char arr1[20] = "Hello ";
	char arr2[] = "World ";
	char arr3[20] = { 0 };
	size_t r1 =my_strlen(arr1);
	char* r2 = my_strcat(arr1, arr2);
	char* r3 = my_strcyp(arr3, arr1);
	printf("%zu %s %s", r1, r2, r3);

	return 0;
}

